<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .container {
            width: 150px;
            height: 50px;
            background: red;
            margin: 100px auto;
            display: flex;
            align-items: center;
            justify-content: space-evenly;
        }

        .container div {
            width: 40px;
            height: 40px;
            background: #000;
            color: #fff;
            text-align: center;
            line-height: 40px;
        }
    </style>
</head>

<body>
    <div class="container">
        <div id="h">00</div>
        <div id="m">00</div>
        <div id="s">00</div>
    </div>


    <script src="https://gitee.com/shendusimba/simbajs/raw/master/simba.js"></script>

    <script>
        var $ = function (id) {
            return document.getElementById(id)
        }

        var endTime = new Date()
        endTime.setHours(endTime.getHours() + 2)
        var hh = $("h")
        var mm = $('m')
        var ss = $('s')
        var formatMSToObj = function (total) {
            var h = _.repairZero(Math.floor(total / 3600))
            var m = _.repairZero(Math.floor((total - h * 3600) / 60))
            var s = _.repairZero(Math.floor(total - h * 3600 - m * 60))
            return {
                h: h,
                m: m,
                s: s
            }
        }
        setInterval(function () {
            var now = new Date()
            var total = (endTime - now) / 1000
            var result = _.formatMs2Obj(total)
            hh.innerHTML = result.h
            mm.innerHTML = result.m
            ss.innerHTML = result.s
        }, 1000)
    </script>
</body>

</html>